<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.multiselect');
JHtml::_('behavior.modal', 'a.modal');

$user		= JFactory::getUser();
$userId		= $user->get('id');

$doc = JFactory::getDocument();
$doc->addStyleSheet("https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/humanity/jquery-ui.css");
$doc->addStyleSheet(JURI::base()."media/system/css/system.css");
$doc->addStyleSheet(JURI::base()."administrator/templates/bluestork/css/template.css");
$doc->addStyleSheet(JURI::base()."components/com_mariageplanner/css/styles.css");

$doc->addScript("https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js");
$doc->addScriptDeclaration('
		jQuery(document).ready(function() {
			jQuery("button").button();
			jQuery("input, textarea, select").addClass("gradient");
		});
');
?>
<section class="ui-widget ui-widget-content ui-corner-all" style="padding: 10px;">
<?php if ($userId==0): ?>
<div id="alert_container" class="ui-widget">
	<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
        <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span></p>
        <p>
		<?php echo JText::sprintf( 'COM_MARIAGEPLANNER_LAYOUTS_LOGIN_WARNING', JRoute::_('index.php?option=com_users&view=login'), JRoute::_('index.php?option=com_users&view=registration')); ?>
		</p>
    </div>
</div>
<?php endif ?>

<form action="<?php echo JRoute::_('index.php?option=com_mariageplanner&view=layouts'); ?>" method="post" name="adminForm" id="adminForm">
	<table class="adminlist">
		<thead>
			<tr>
				<th width="1%">
					<input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
				</th>
				<th>
					<?php echo JText::_('COM_MARIAGEPLANNER_LAYOUT_HEADING_TITLE'); ?>
				</th>
				<th width="5%">
				</th>
				<th width="5%">
				</th>
				<th width="5%">
					<?php echo JText::_('JSTATUS'); ?>
				</th>
			</tr>		
		</thead>
		<!-- <tfoot>
			<tr>
				<td colspan="6"><?php echo $this->pagination->getListFooter(); ?></td>
			</tr>
		</tfoot>  -->
		<tbody>
	
<?php echo $this->loadTemplate('items'); ?>

		</tbody>
	</table>
	<div>
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<?php echo JHtml::_('form.token'); ?>
	</div>

	<div class="toolbar">
		<a href="<?php echo JRoute::_('index.php?option=com_mariageplanner&view=layout&layout=edit'); ?>"><button class="gradient" type="button">Добавить новую схему рассадки</button></a>
		<a href="javascript: void(0);" onclick="Joomla.submitform('layouts.save');"><button class="gradient" type="button">Сохранить схему(ы)</button></a>
        <a href="<?php echo JRoute::_('index.php?option=com_content&view=article&id=518&tmpl=component'); ?>" 
            class="highslide" onclick="return hs.htmlExpand(this,{align: 'center', easing: 'easeInOutBounce', easingClose: 'linearTween', allowSizeReduction: true, fadeInOut: true, outlineType: 'drop-shadow', width: 1000, height: 700, objectType: 'iframe'})"><button class="gradient" type="button">Посмотреть обучающее видео</button></a>
	</div>
</form>
</section>